package com.sky.mapper.admin;


import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.EmployeePageQueryDTO;
import com.sky.enumeration.OperationType;
import com.sky.pojo.Employee;
import org.apache.ibatis.annotations.*;


@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    @Select("select * from employee where username = #{username}")
    Employee getByUsername(String username);

/**
 * 新增员工
 * @param employee
 */
@AutoFill(value = OperationType.INSERT)
void insert(Employee employee);

/**
 * 分页查询
 */
Page<Employee> pageQuery(EmployeePageQueryDTO employeePageQueryDTO);

/**
 * 启用禁用员工账号
 * @param status
 * @param id
 */
void startOrStop(Integer status, Long id);

/**
 * 根据id查询员工信息
 * @param id
 * @return
 */
Employee getById(Long id);

/**
 * 编辑员工信息
 * @param employee
 */
@AutoFill(value = OperationType.UPDATE)
void update(Employee employee);
}
